#! /bin/bash
if [[ -z $1 ]]; then
  set -- "latest" "$1"
fi
version=$1
echo "image version:$version"
cur_dir=$(pwd)
echo "current dir:$cur_dir"

docker pull harbor-dev.inspuriip.com/hubs/maven:icd2024

docker run --rm \
	--network host \
	-v /data/repo:/data/repo \
        -v /data/settings.xml:/home/settings.xml \
	-v $cur_dir:$cur_dir \
	-w $cur_dir \
	harbor-dev.inspuriip.com/hubs/maven:icd2024 \
	mvn clean package -Dmaven.test.skip=true -s /home/settings.xml -DsendCredentialsOverHttp=true -DbuildVersion=$version
